﻿
Partial Class Interfaz_frmSistemaConfiguracionMail
    Inherits System.Web.UI.Page
    Dim Cl As New ControladorLogica


#Region "Funciones"
    Private Sub CargarDatosMailBDO(ByVal opcion As Integer)

        If opcion = 1 Then
            Dim smtp As String = Me.TxtSMTP.Text
            Dim nombreCuenta As String = Me.TxTNombreCuenta.Text
            Dim pass As String = Me.TxTPass.Text
            Dim repitePass As String = Me.TxTRepite.Text

            If (repitePass <> pass) Then
                MsgBox("Las contraseñas no concuerdan intentelo nuevamente")
            Else
                Dim nuevoMail As New Mail(smtp, nombreCuenta, pass, "A")
                Cl.insertaNuevoMail(nuevoMail)
                clean()
                MsgBox(" Los datos han sido almacenados correctamente")

            End If
        Else
            If opcion = 0 Then

            End If
        End If
    End Sub

    Private Sub clean()
        Me.TxTNombreCuenta.Text = String.Empty
        Me.TxTPass.Text = String.Empty
        Me.TxTRepite.Text = String.Empty
        Me.TxtSMTP.Text = String.Empty
    End Sub
#End Region

#Region "Botones"
    Protected Sub BtnSetear1Cuenta_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnSetear1Cuenta.Click
        CargarDatosMailBDO(1)
    End Sub
#End Region

    
End Class
